home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
By Popular Request 2.0
/
By Popular Request 2.0 (Arsenal Computer).ISO
/
amiga_3
/
ezbbs221.lha
/
Source
/
exist.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-12
|
536b
|
35 lines
#include <stdio.h>
#include <stdlib.h>
#include <dos/dos.h>
#include <exec/memory.h>
#include <proto/dos.h>
#include <proto/exec.h>
int main (int argc, char *argv[])
{
long howmany = 0;
if (argc == 2) {
struct AnchorPath *ap;
if (ap = AllocVec (sizeof (struct AnchorPath), MEMF_PUBLIC | MEMF_CLEAR)) {
long err;
for (err = MatchFirst (argv[1], ap); err == 0; err = MatchNext (ap)) {
++howmany;
}
if (err == ERROR_OBJECT_IN_USE)
++howmany;
MatchEnd (ap);
FreeVec (ap);
}
}
exit (howmany);
}